<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateAppliesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('applies', function (Blueprint $table) {
            $table->id();
            $table->integer('visitor_id')->comment('访客者ID');
            $table->integer('staff_id')->comment('被访者ID');
            $table->string('reason', 100)->comment('访问事由');
            $table->string('partners')->comment('随行人员');
            $table->date('visit_date')->comment('到访日期');
            $table->string('visit_time')->comment('到访时间');
            $table->tinyInteger('status')->default(1)->comment('1审核中 2已通过 3未通过 4已取消 5已到访');
            $table->string('remark', 200)->nullable()->comment('备注');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('applies');
    }
}
